<template>
  <div class="common-layout">
    <el-container>
      <!-- 左边 -->
      <el-aside width="200px" class="left">
        <el-row class="tac">
          <el-col :span="12">
            <el-menu default-active="/listView/home" class="el-menu-vertical-demo" background-color="#304156" router
              text-color="#fff">
              <!-- 首页 -->
              <el-menu-item index="/listView/home">
                <el-icon>
                  <!-- <setting /> -->
                </el-icon>
                <span class="iconfont icon-dashboard"></span>
                <template #title
          
                >首页</template>
              </el-menu-item>


              <!-- 访客管理 -->
              <el-sub-menu index="2">
                <template #title>
                  <el-icon>
                    <!-- <location /> -->
                  </el-icon>
                  <span class="iconfont icon-table"></span>
                  <span class="first">访客记录</span>
                </template>
                <!-- <el-menu-item-gro> -->
                <el-menu-item index="/listView/drag-table" class="colorer">访客列表</el-menu-item>
                <el-menu-item index="/listView/inline-edit-table" class="colorer">访客添加修改</el-menu-item>
                <el-menu-item index="/listView/instructions-excel" class="colorer">负责人操作详情</el-menu-item>
                <!-- </el-menu-item-gro> -->
              </el-sub-menu>
              <!--部门管理 -->
              <el-sub-menu index="3">
                <template #title>
                  <el-icon>
                    <!-- <location /> -->
                  </el-icon>
                  <span class="iconfont icon-chart"></span>
                  <span class="first">部门管理</span>
                </template>
                <el-menu-item index="/listView/keyboard" class="colorer">部门列表</el-menu-item>
                <el-menu-item index="/listView/keyboardadd" class="colorer">部门添加修改</el-menu-item>
              </el-sub-menu>
              <!-- 管理员 -->
              <el-sub-menu index="4">
                <template #title>
                  <el-icon>
                    <!-- <location /> -->
                  </el-icon>
                  <span class="iconfont icon-suoding"></span>
                  <span class="first">管理员</span>
                </template>
                <el-menu-item index="/listView/adminlist" class="colorer">管理员列表</el-menu-item>
                <el-menu-item index="/listView/adminadd" class="colorer">管理员添加修改</el-menu-item>
              </el-sub-menu>

              <!-- 核销人员管理 -->
              <el-sub-menu index="5">
                <template #title>
                  <el-icon>
                    <!-- <location /> -->
                  </el-icon>
                  <span class="iconfont icon-s-help"></span>
                  <span class="first">核销人员管理</span>
                </template>
                <el-menu-item index="/listView/reviewerlist" class="colorer">核销人员管理列表</el-menu-item>
                <el-menu-item index="/listView/revieweradd" class="colorer">核销人员管理添加修改</el-menu-item>
                <el-menu-item index="/listView/reviewerlog" class="colorer">核销人员日志</el-menu-item>
              </el-sub-menu>

              <!-- 审核日志 -->
              <el-sub-menu index="6">
                <template #title>
                  <el-icon>
                    <!-- <location /> -->
                  </el-icon>
                  <span class="iconfont icon-excel"></span>
                  <span class="first">审核日志</span>
                </template>
                <el-menu-item index="/listView/export-excel" class="colorer">审核列表</el-menu-item>
              </el-sub-menu>

              <!-- 校园动态 -->
              <el-sub-menu index="7">
                <template #title>
                  <el-icon>
                    <!-- <location /> -->
                  </el-icon>
                  <span class="iconfont icon-component"></span>
                  <span class="first">校园动态</span>
                </template>
                <el-menu-item index="/listView/newslist" class="colorer">校园动态列表</el-menu-item>
                <el-menu-item index="/listView/newsadd" class="colorer">校园动态添加修改</el-menu-item>
              </el-sub-menu>

              <!-- 设置 -->
              <el-menu-item index="/listView/settings">
                <el-icon>
                  <!-- <location /> -->
                </el-icon>
                <span class="iconfont icon-tree"></span>
                <template #title 

    
                
                >设置</template> 
              </el-menu-item>

            </el-menu>
          </el-col>
        </el-row>
        <!-- ////// -->
      </el-aside>

      <el-container>
        <!-- 头部 -->
        <el-header class="head main">
          <!-- 面包屑 -->
          <div class="headertop">
            <HeaderView></HeaderView>
            <div class="admin">
              <div class="qwe  iconfont icon-quanping" @click="tooggleFullscreen()">
              </div> <!--全屏-->

              <el-dropdown trigger="click" class="jfhh">
                <span class="el-dropdown-link">
                  {{ name.name1.admin_name }}
                  <text class="iconfont icon-xiangxiajiantou"></text>
                </span>
                <template #dropdown>
                  <el-dropdown-menu>
                    <el-dropdown-item>个人资料修改</el-dropdown-item>
                    <el-dropdown-item @click="Logout">退出登录</el-dropdown-item>
                  </el-dropdown-menu>
                </template>
              </el-dropdown>

            </div>
          </div>
        </el-header>

        <!-- 路由导航 -->
        <div style="padding:0 20px;" class="main">
          <TagList></TagList>
        </div>

        <el-main class="main">
          <router-view />
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script lang="ts" setup>
import { reactive } from "vue";
import screenfull from 'screenfull'
import HeaderView from "../components/header/HeaderView.vue"; //头部
import TagList from '../components/tagview.vue'//路由导航

// let name1: any = ref(null);
let name: any = reactive({
  name1: JSON.parse(localStorage.getItem("userInfo") as any), //断言 as
});
// 全屏
const tooggleFullscreen = () => {
  if (screenfull.isEnabled) {
    screenfull.toggle()
  }
}

// 退出登录
let Logout = () => {
  localStorage.setItem('token', '')
  window.location.reload()
}


</script>
<style scoped lang="less">
.left {
  width: 200px;
  height: 100vh;
  overflow: hidden;
  background-color: #304156;
  position: fixed;
  z-index: 1000;
}

.main {
  margin-left: 200px;
}

.el-menu-item is-active {
  width: 200px;
  background-color: #304156;
}

.el-row {
  width: 400px;
  background-color: #304156;
  text-align: center;
}

.el-menu-item {
  padding: 0 !important;
}

/deep/.el-sub-menu__title {
  padding: 0 !important;
}

.first {
  margin-left: 10px;
  color: white;
}

.colorer {
  padding-left: 50px !important;
  color: rgb(191, 203, 217);
  background-color: #1f2d3d;
}

//鼠标滑过
.colorer:hover {
  background-color: #17222e;
}

.iconfont {
  color: rgb(191, 203, 217);
}

.icon-dashboard {
  margin-right: 10px;
}

/deep/.el-icon {
  color: rgb(191, 203, 217) !important;
}

// 点击变色
.is-active {
  color: rgb(64 158 255);
}

.el-sub-menu .el-sub-menu__icon-arrow {
  color: rgb(191, 203, 217);
}

.headertop {
  width: 100%;
  height: 50px;
  /* background-color: aquamarine; */
  border-bottom: 1px solid rgba(0, 21, 41, 0.08);
  display: flex;

  align-items: center;
}

.head {
  display: flex;
  justify-content: space-between;
}

.admin {
  font-weight: 900;
  display: flex;
  justify-content: space-between;
  position: absolute;
  right: 25px;
  margin-right: 10px;
}

.bigFont {
  margin-left: 5%;
}

.qwe {
  font-size: 28px;
  margin-right: 20px;
}

.el-icon svg {
  height: 1em;
  width: 1em;
  color: #000;
}

.jfhh {
  margin-top: 5px;
}

.icon-tree{
  margin-right: 10px;
}

</style>
